package com.hspedu.chapter_assignment;

public class HomeWork06 {
    public static void main(String[] args) {
        Car car = new Car(45);
        Car car1 = new Car(30);
        Car car2 = new Car(-7);
        car.new Air().flow();
        car1.new Air().flow();
        car2.new Air().flow();
    }
}


class Car {
    private double temperature;

    class Air {
        public void flow() {
            if (temperature >= 40) {
                System.out.println("吹冷风");
            } else if (temperature < 0) {
                System.out.println("吹暖风");
            } else {
                System.out.println("关掉空调");
            }
        }
    }

    public Car(double temperature) {
        this.temperature = temperature;
    }
}